import {createStore, combineReducers, applyMiddleware} from "redux"
import thunk from "redux-thunk"
import userReducer from "./userStore/reducer"

// 风控管理
import rcmanagement from './RcManagement/reducer'

const mainReducer = combineReducers({//combineReducers将多个 Reducer 进行合并。
  user: userReducer,
  rc_manage: rcmanagement,
})

const store = createStore(mainReducer, applyMiddleware(thunk))//applyMiddleware中间键组成数组 处理异步存放thunk

store.subscribe(() => {
  //获取数据
  console.log("store 更新：", store.getState())
})

export default store
